home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Interfaces / MPW Interfaces / PInterfaces / AppleEvents.p < prev    next >
Encoding:
Text File  |  1993-09-17  |  22.8 KB  |  599 lines  |  [TEXT/MPS ]

  1. {
  2.     File:        AppleEvents.p
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. }
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT AppleEvents;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingAppleEvents}
  22. {$SETC UsingAppleEvents := 1}
  23.  
  24. {$I+}
  25. {$SETC AppleEventsIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingTypes}
  28. {$I $$Shell(PInterfaces)Types.p}
  29. {$ENDC}
  30. {$IFC UNDEFINED UsingMemory}
  31. {$I $$Shell(PInterfaces)Memory.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingOSUtils}
  34. {$I $$Shell(PInterfaces)OSUtils.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED UsingEvents}
  37. {$I $$Shell(PInterfaces)Events.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED UsingEPPC}
  40. {$I $$Shell(PInterfaces)EPPC.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED UsingNotification}
  43. {$I $$Shell(PInterfaces)Notification.p}
  44. {$ENDC}
  45. {$SETC UsingIncludes := AppleEventsIncludes}
  46.  
  47. CONST
  48. typeBoolean = 'bool';
  49. typeChar = 'TEXT';
  50. typeSMInt = 'shor';
  51. typeInteger = 'long';
  52. typeSMFloat = 'sing';
  53. typeFloat = 'doub';
  54. typeLongInteger = 'long';
  55. typeShortInteger = 'shor';
  56. typeLongFloat = 'doub';
  57. typeShortFloat = 'sing';
  58. typeExtended = 'exte';
  59. typeComp = 'comp';
  60. typeMagnitude = 'magn';
  61. typeAEList = 'list';
  62. typeAERecord = 'reco';
  63. typeTrue = 'true';
  64. typeFalse = 'fals';
  65. typeAlias = 'alis';
  66. typeEnumerated = 'enum';
  67. typeType = 'type';
  68. typeAppParameters = 'appa';
  69. typeProperty = 'prop';
  70. typeFSS = 'fss ';
  71. typeKeyword = 'keyw';
  72. typeSectionH = 'sect';
  73. typeWildCard = '****';
  74.  
  75. typeApplSignature = 'sign';
  76. typeSessionID = 'ssid';
  77. typeTargetID = 'targ';
  78. typeProcessSerialNumber = 'psn ';
  79. typeNull = 'null';                    {the type of null/nonexistent data}
  80.  
  81. kCoreEventClass = 'aevt';
  82.  
  83. kAEOpenApplication = 'oapp';
  84. kAEOpenDocuments = 'odoc';
  85. kAEPrintDocuments = 'pdoc';
  86. kAEQuitApplication = 'quit';
  87.  
  88. kAECreatorType = 'crea';
  89. kAEQuitAll = 'quia';
  90. kAEShutDown = 'shut';
  91. kAERestart = 'rest';
  92. kAEApplicationDied = 'obit';
  93. keyProcessSerialNumber = 'psn ';
  94.  
  95. keyErrorNumber = 'errn';
  96. keyErrorString = 'errs';
  97.  
  98. kAEAnswer = 'ansr';
  99.  
  100. keyDirectObject = '----';
  101.  
  102.  
  103. { keyword used in install special handler }
  104. keyPreDispatch = 'phac';            { PreHandler Accessor Call }
  105. keySelectProc = 'selh';                { More selector Call }
  106.  
  107. { keywords used in attributes }
  108. keyTransactionIDAttr = 'tran';
  109. keyReturnIDAttr = 'rtid';
  110. keyEventClassAttr = 'evcl';
  111. keyEventIDAttr = 'evid';
  112. keyAddressAttr = 'addr';
  113. keyOptionalKeywordAttr = 'optk';
  114. keyTimeoutAttr = 'timo';
  115. keyInteractLevelAttr = 'inte';        {this attribute is read only will be set in AESend}
  116. keyEventSourceAttr = 'esrc';        { this attribute is read only }
  117. keyMissedKeywordAttr = 'miss';        { this attribute is read only }
  118.  
  119. { constants for use in AESendMode }
  120. kAENoReply = $00000001;                { Sender doesn't want a reply to event }
  121. kAEQueueReply = $00000002;            { Sender wants a reply but won't wait }
  122. kAEWaitReply = $00000003;            { Sender wants a reply and will be waiting }
  123.  
  124. kAENeverInteract = $00000010;        { Server should not interact with user }
  125. kAECanInteract = $00000020;            { Server may try to interact with user }
  126. kAEAlwaysInteract = $00000030;        { Server should always interact with user where appropriate }
  127.  
  128. kAECanSwitchLayer = $00000040;        { Interaction may switch layer }
  129.  
  130. kAEDontReconnect = $00000080;        { don't reconnect if there is a sessClosedErr from PPCToolbox }
  131.  
  132. kAEWantReceipt = nReturnReceipt;    { Send wants a receipt of message }
  133.  
  134. { constants to be used in AESendPriority }
  135. kAENormalPriority = $00000000;        { Post message at the end of event queue }
  136. kAEHighPriority = nAttnMsg;            { Post message at the front of the event queue }
  137.  
  138. { special constants in generating events }
  139. kAnyTransactionID = 0;                { no transaction is in use }
  140. kAutoGenerateReturnID = -1;            { AECreateAppleEvent will generate a session-unique ID }
  141.  
  142. { constant for use AESend }
  143. kAEDefaultTimeout = -1;                { timeout value determined by AEM }
  144. kNoTimeOut = -2;                    { wait until reply comes back, however long it takes }
  145.  
  146. { dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch
  147. table, or one of these two constants }
  148. kAENoDispatch = 0;
  149. kAEUseStandardDispatch = -1;
  150.  
  151. { Error messages in response to reading and writing event contents }
  152. errAECoercionFail = -1700;
  153. errAEDescNotFound = -1701;
  154. errAECorruptData = -1702;
  155. errAEWrongDataType = -1703;
  156. errAENotAEDesc = -1704;
  157. errAEBadListItem = -1705;            { Specified list item does not exist }
  158. errAENewerVersion = -1706;            { Need newer version of AppleEvent Manager }
  159. errAENotAppleEvent = -1707;            { The event is not in AppleEvent format }
  160.  
  161. { Error messages in response to sending/receiving a message }
  162. errAEEventNotHandled = -1708;        { The AppleEvent was not handled by any handler }
  163. errAEReplyNotValid = -1709;            { AEResetTimer was passed an invalid reply parameter }
  164. errAEUnknownSendMode = -1710;        { Mode wasn't NoReply, WaitReply, or QueueReply;  or Interaction level is unknown }
  165. errAEWaitCanceled = -1711;            { In AESend, User cancelled out of wait loop for  reply or receipt }
  166. errAETimeout = -1712;                { AppleEvent timed out }
  167.  
  168. errAENoUserInteraction = -1713;        { no user interaction allowed }
  169. errAENotASpecialFunction = -1714;    { there is no special function with this keyword }
  170. errAEParamMissed = -1715;            { a required parameter was not accessed }
  171.  
  172. errAEUnknownAddressType = -1716;    { The target address type is not known }
  173. errAEHandlerNotFound = -1717;        { No handler in the dispatch tables fits the parameters to
  174.              AEGetEventHandler or AEGetCoercionHandler }
  175.  
  176. errAEReplyNotArrived = -1718;        { the contents of the reply you are accessing have not arrived yet }
  177. errAEIllegalIndex = -1719;            { Index is out of range in a put operation }
  178.  
  179. TYPE
  180. AEKeyword    = PACKED ARRAY [1..4] OF CHAR;
  181. AEEventClass  = PACKED ARRAY [1..4] OF CHAR;
  182. AEEventID    = PACKED ARRAY [1..4] OF CHAR;
  183. DescType = ResType;
  184.  
  185. { tagged data, the standard AppleEvent data type }
  186. AEDesc = RECORD
  187.  descriptorType: DescType;
  188.  dataHandle: Handle;
  189.  END;
  190.  
  191.  
  192. AEAddressDesc = AEDesc;                { an AEDesc which contains addressing data }
  193. AEDescList = AEDesc;                { a list of AEDesc is a special kind of AEDesc }
  194. AERecord = AEDescList;                { AERecord is a list of keyworded AEDesc }
  195. AppleEvent = AERecord;                { an AERecord that contains an AppleEvent }
  196. AESendMode = LONGINT;                { Type of parameter to AESend }
  197. AESendPriority = INTEGER;            { Type of priority param of AESend }
  198.  
  199. { type of param to AEGetInteractionAllowed and AESetInteractionAllowed }
  200. AEInteractAllowed = (kAEInteractWithSelf,kAEInteractWithLocal,kAEInteractWithAll);
  201.  
  202. { Return param to AEGetTheCurrentEvent, and kAEEventSource attribute }
  203. AEEventSource = (kAEUnknownSource,kAEDirectCall,kAESameProcess,kAELocalProcess,
  204.  kAERemoteProcess);
  205.  
  206.  
  207. { types for AppleEvent Array support 
  208.  
  209.  Basic data type of attibutes & parameters}
  210. AEKeyDesc = RECORD
  211.  descKey: AEKeyword;
  212.  descContent: AEDesc;
  213.  END;
  214.  
  215.  
  216. AEArrayType = (kAEDataArray,kAEPackedArray,kAEHandleArray,kAEDescArray,
  217.  kAEKeyDescArray);
  218.  
  219.  
  220. { Array routines support these different types of elements}
  221. AEArrayData = RECORD
  222.  case AEArrayType OF
  223.   kAEDataArray: 
  224.    (AEDataArray:   Array[0..0] OF Integer);
  225.   kAEPackedArray: 
  226.    (AEPackedArray:  Packed Array[0..0] OF Char);
  227.   kAEHandleArray: 
  228.    (AEHandleArray:  Array[0..0] OF Handle);
  229.   kAEDescArray: 
  230.    (AEDescArray:   Array[0..0] OF AEDesc);
  231.   kAEKeyDescArray: 
  232.    (AEKeyDescArray:  Array[0..0] OF AEKeyDesc);
  233.  END;
  234.  
  235. AEArrayDataPointer = ^AEArrayData;
  236.  
  237.  
  238.  
  239. EventHandlerProcPtr = ProcPtr;
  240. IdleProcPtr = ProcPtr;
  241. EventFilterProcPtr = ProcPtr;
  242.  
  243.  
  244. {   *********************************************************************
  245. The following calls apply to any AEDesc. Every result descriptor is created for you,
  246. so you will be responsible for memory management of the descriptors so created.
  247. Purgeable descriptor data is not supported: the AEM does not call LoadResource.   }
  248. FUNCTION AECreateDesc(typeCode: DescType;
  249.                       dataPtr: Ptr;
  250.                       dataSize: Size;
  251.                       VAR result: AEDesc): OSErr;
  252.  INLINE $303C, $0825, $A816;
  253. FUNCTION AECoercePtr(typeCode: DescType;
  254.                      dataPtr: Ptr;
  255.                      dataSize: Size;
  256.                      toType: DescType;
  257.                      VAR result: AEDesc): OSErr;
  258.  INLINE $303C, $0A02, $A816;
  259. FUNCTION AECoerceDesc(theAEDesc: AEDesc;
  260.                       toType: DescType;
  261.                       VAR result: AEDesc): OSErr;
  262.  INLINE $303C, $0603, $A816;
  263. FUNCTION AEDisposeDesc(VAR theAEDesc: AEDesc): OSErr;
  264.  INLINE $303C, $0204, $A816;
  265. FUNCTION AEDuplicateDesc(theAEDesc: AEDesc;
  266.                          VAR result: AEDesc): OSErr;
  267.  INLINE $303C, $0405, $A816;
  268.  
  269. { *********************************************************************
  270.  The following calls apply to AEDescList.
  271.   Since AEDescList is a subtype of AEDesc, the calls in the previous
  272.   section can also be used for AEDescList. All list and array indices are 1-based.
  273.   If the data was greater than maximumSize in the routines below, then actualSize will
  274.   be greater than maximumSize, but only maximumSize bytes will actually be retrieved. }
  275. FUNCTION AECreateList(factoringPtr: Ptr;
  276.                       factoredSize: Size;
  277.                       isRecord: BOOLEAN;
  278.                       VAR resultList: AEDescList): OSErr;
  279.  INLINE $303C, $0706, $A816;
  280. FUNCTION AECountItems(theAEDescList: AEDescList;
  281.                       VAR theCount: LONGINT): OSErr;
  282.  INLINE $303C, $0407, $A816;
  283. FUNCTION AEPutPtr(theAEDescList: AEDescList;
  284.                   index: LONGINT;
  285.                   typeCode: DescType;
  286.                   dataPtr: Ptr;
  287.                   dataSize: Size): OSErr;
  288.  INLINE $303C, $0A08, $A816;
  289. FUNCTION AEPutDesc(theAEDescList: AEDescList;
  290.                    index: LONGINT;
  291.                    theAEDesc: AEDesc): OSErr;
  292.  INLINE $303C, $0609, $A816;
  293. FUNCTION AEGetNthPtr(theAEDescList: AEDescList;
  294.                      index: LONGINT;
  295.                      desiredType: DescType;
  296.                      VAR theAEKeyword: AEKeyword;
  297.                      VAR typeCode: DescType;
  298.                      dataPtr: Ptr;
  299.                      maximumSize: Size;
  300.                      VAR actualSize: Size): OSErr;
  301.  INLINE $303C, $100A, $A816;
  302. FUNCTION AEGetNthDesc(theAEDescList: AEDescList;
  303.                       index: LONGINT;
  304.                       desiredType: DescType;
  305.                       VAR theAEKeyword: AEKeyword;
  306.                       VAR result: AEDesc): OSErr;
  307.  INLINE $303C, $0A0B, $A816;
  308. FUNCTION AESizeOfNthItem(theAEDescList: AEDescList;
  309.                          index: LONGINT;
  310.                          VAR typeCode: DescType;
  311.                          VAR dataSize: Size): OSErr;
  312.  INLINE $303C, $082A, $A816;
  313. FUNCTION AEGetArray(theAEDescList: AEDescList;
  314.                     arrayType: AEArrayType;
  315.                     arrayPtr: AEArrayDataPointer;
  316.                     maximumSize: Size;
  317.                     VAR itemType: DescType;
  318.                     VAR itemSize: Size;
  319.                     VAR itemCount: LONGINT): OSErr;
  320.  INLINE $303C, $0D0C, $A816;
  321. FUNCTION AEPutArray(theAEDescList: AEDescList;
  322.                     arrayType: AEArrayType;
  323.                     arrayPtr: AEArrayDataPointer;
  324.                     itemType: DescType;
  325.                     itemSize: Size;
  326.                     itemCount: LONGINT): OSErr;
  327.  INLINE $303C, $0B0D, $A816;
  328. FUNCTION AEDeleteItem(theAEDescList: AEDescList;
  329.                       index: LONGINT): OSErr;
  330.  INLINE $303C, $040E, $A816;
  331.  
  332. { *********************************************************************
  333. The following calls apply to AERecord.
  334.   Since AERecord is a subtype of AEDescList, the calls in the previous
  335.   sections can also be used for AERecord
  336.   an AERecord can be created by using AECreateList with isRecord set to true  }
  337. FUNCTION AEPutKeyPtr(theAERecord: AERecord;
  338.                      theAEKeyword: AEKeyword;
  339.                      typeCode: DescType;
  340.                      dataPtr: Ptr;
  341.                      dataSize: Size): OSErr;
  342.  INLINE $303C, $0A0F, $A816;
  343. FUNCTION AEPutKeyDesc(theAERecord: AERecord;
  344.                       theAEKeyword: AEKeyword;
  345.                       theAEDesc: AEDesc): OSErr;
  346.  INLINE $303C, $0610, $A816;
  347. FUNCTION AEGetKeyPtr(theAERecord: AERecord;
  348.                      theAEKeyword: AEKeyword;
  349.                      desiredType: DescType;
  350.                      VAR typeCode: DescType;
  351.                      dataPtr: Ptr;
  352.                      maximumSize: Size;
  353.                      VAR actualSize: Size): OSErr;
  354.  INLINE $303C, $0E11, $A816;
  355. FUNCTION AEGetKeyDesc(theAERecord: AERecord;
  356.                       theAEKeyword: AEKeyword;
  357.                       desiredType: DescType;
  358.                       VAR result: AEDesc): OSErr;
  359.  INLINE $303C, $0812, $A816;
  360. FUNCTION AESizeOfKeyDesc(theAERecord: AERecord;
  361.                          theAEKeyword: AEKeyword;
  362.                          VAR typeCode: DescType;
  363.                          VAR dataSize: Size): OSErr;
  364.  INLINE $303C, $0829, $A816;
  365. FUNCTION AEDeleteKeyDesc(theAERecord: AERecord;
  366.                          theAEKeyword: AEKeyword): OSErr;
  367.  INLINE $303C, $0413, $A816;
  368.  
  369.  *********************************************************************
  370.  The following calls are used to pack and unpack parameters from records of
  371.  type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls in the previous
  372.  sections can also be used for variables of type AppleEvent. The next six calls
  373.  are in fact identical to the six calls for AERecord.
  374.  }
  375. FUNCTION AEPutParamPtr(theAppleEvent: AppleEvent;
  376.                        theAEKeyword: AEKeyword;
  377.                        typeCode: DescType;
  378.                        dataPtr: Ptr;
  379.                        dataSize: Size): OSErr;
  380.  INLINE $303C,$0A0F,$A816;
  381. FUNCTION AEPutParamDesc(theAppleEvent: AppleEvent;
  382.                         theAEKeyword: AEKeyword;
  383.                         theAEDesc: AEDesc): OSErr;
  384.  INLINE $303C,$0610,$A816;
  385. FUNCTION AEGetParamPtr(theAppleEvent: AppleEvent;
  386.                        theAEKeyword: AEKeyword;
  387.                        desiredType: DescType;
  388.                        VAR typeCode: DescType;
  389.                        dataPtr: Ptr;
  390.                        maximumSize: Size;
  391.                        VAR actualSize: Size): OSErr;
  392.  INLINE $303C,$0E11,$A816;
  393. FUNCTION AEGetParamDesc(theAppleEvent: AppleEvent;
  394.                         theAEKeyword: AEKeyword;
  395.                         desiredType: DescType;
  396.                         VAR result: AEDesc): OSErr;
  397.  INLINE $303C,$0812,$A816;
  398. FUNCTION AESizeOfParam(theAppleEvent: AppleEvent;
  399.                        theAEKeyword: AEKeyword;
  400.                        VAR typeCode: DescType;
  401.                        VAR dataSize: Size): OSErr;
  402.  INLINE $303C,$0829,$A816;
  403. FUNCTION AEDeleteParam(theAppleEvent: AppleEvent;
  404.                        theAEKeyword: AEKeyword): OSErr;
  405.  INLINE $303C,$0413,$A816;
  406.  
  407. { *********************************************************************
  408. The following calls also apply to type AppleEvent.  Message attributes are far more restricted, and
  409. can only be accessed through the following 5 calls. The various list and record routines cannot be used
  410. to access the attributes of an event.  }
  411. FUNCTION AEGetAttributePtr(theAppleEvent: AppleEvent;
  412.                            theAEKeyword: AEKeyword;
  413.                            desiredType: DescType;
  414.                            VAR typeCode: DescType;
  415.                            dataPtr: Ptr;
  416.                            maximumSize: Size;
  417.                            VAR actualSize: Size): OSErr;
  418.  INLINE $303C,$0E15,$A816;
  419. FUNCTION AEGetAttributeDesc(theAppleEvent: AppleEvent;
  420.                             theAEKeyword: AEKeyword;
  421.                             desiredType: DescType;
  422.                             VAR result: AEDesc): OSErr;
  423.  INLINE $303C,$0826,$A816;
  424. FUNCTION AESizeOfAttribute(theAppleEvent: AppleEvent;
  425.                            theAEKeyword: AEKeyword;
  426.                            VAR typeCode: DescType;
  427.                            VAR dataSize: Size): OSErr;
  428.  INLINE $303C,$0828,$A816;
  429. FUNCTION AEPutAttributePtr(theAppleEvent: AppleEvent;
  430.                            theAEKeyword: AEKeyword;
  431.                            typeCode: DescType;
  432.                            dataPtr: Ptr;
  433.                            dataSize: Size): OSErr;
  434.  INLINE $303C,$0A16,$A816;
  435. FUNCTION AEPutAttributeDesc(theAppleEvent: AppleEvent;
  436.                             theAEKeyword: AEKeyword;
  437.                             theAEDesc: AEDesc): OSErr;
  438.  INLINE $303C,$0627,$A816;
  439.  
  440. { *********************************************************************
  441.  The next four calls are basic routines used to create, send, and process AppleEvents.  }
  442. FUNCTION AECreateAppleEvent(theAEEventClass: AEEventClass;
  443.                             theAEEventID: AEEventID;
  444.                             target: AEAddressDesc;
  445.                             returnID: INTEGER;
  446.                             transactionID: LONGINT;
  447.                             VAR result: AppleEvent): OSErr;
  448.  INLINE $303C,$0B14,$A816;
  449. FUNCTION AESend(theAppleEvent: AppleEvent;
  450.                 VAR reply: AppleEvent;
  451.                 sendMode: AESendMode;
  452.                 sendPriority: AESendPriority;
  453.                 timeOutInTicks: LONGINT;
  454.                 idleProc: IdleProcPtr;
  455.                 filterProc: EventFilterProcPtr): OSErr;
  456.  INLINE $303C,$0D17,$A816;
  457. FUNCTION AEProcessAppleEvent(theEventRecord: EventRecord): OSErr;
  458.  INLINE $303C,$021B,$A816;
  459.  
  460. { During event processing, an event handler may realize that it is likely
  461. to exceed the client's timeout limit. Passing the reply to this
  462. routine causes a wait event to be generated to ask the client for more time.  }
  463. FUNCTION AEResetTimer(reply: AppleEvent): OSErr;
  464.  INLINE $303C,$0219,$A816;
  465.  
  466. {   *********************************************************************
  467. The following four calls are available for applications which need more sophisticated control
  468. over when and how events are processed. Applications which implement multi-session servers or 
  469. which implement their own internal event queueing will probably be the major clients of these
  470. routines.  
  471.  
  472.  Can be called from within a handler to prevent the AEM from disposing of
  473. the AppleEvent when the handler returns. Can be used to asynchronously process the 
  474. event (as in MacApp). }
  475. FUNCTION AESuspendTheCurrentEvent(theAppleEvent: AppleEvent): OSErr;
  476.  INLINE $303C,$022B,$A816;
  477.  
  478.   Tells the AppleEvent manager that processing is either about to resume or has
  479.  been completed on a previously suspended event. The procPtr passed in as the
  480.  dispatcher parameter will be called to attempt to redispatch the event. Several
  481.  constants for the dispatcher parameter allow special behavior. They are:
  482.  - kAEUseStandardDispatch means redispatch as if the event was just received, using the
  483.   standard AppleEvent Dispatcher.
  484.  - kAENoDispatch means ignore the parameter.
  485.   Use this in the case where no redispatch is needed, and the event has been handled.
  486.  - non nil means call the routine which dispatcher points to.
  487.  }
  488. FUNCTION AEResumeTheCurrentEvent(theAppleEvent: AppleEvent;
  489.                                  reply: AppleEvent;
  490.                                  dispatcher: EventHandlerProcPtr;
  491.                                  handlerRefcon: LONGINT): OSErr;
  492.  INLINE $303C,$0818,$A816;
  493.  
  494. { Allows application to examine the currently executing event }
  495. FUNCTION AEGetTheCurrentEvent(VAR theAppleEvent: AppleEvent): OSErr;
  496.  INLINE $303C,$021A,$A816;
  497.  
  498. { Set the current event to the parameter }
  499. FUNCTION AESetTheCurrentEvent(theAppleEvent: AppleEvent): OSErr;
  500.  INLINE $303C,$022C,$A816;
  501.  
  502.  *********************************************************************
  503.   The following three calls are used to allow applications to behave courteously 
  504.  when a user interaction such as a dialog box is needed. 
  505.  }
  506. FUNCTION AEGetInteractionAllowed(VAR level: AEInteractAllowed): OSErr;
  507.  INLINE $303C,$021D,$A816;
  508. FUNCTION AESetInteractionAllowed(level: AEInteractAllowed): OSErr;
  509.  INLINE $303C,$011E,$A816;
  510. FUNCTION AEInteractWithUser(timeOutInTicks: LONGINT;
  511.                             nmReqPtr: NMRecPtr;
  512.                             idleProc: IdleProcPtr): OSErr;
  513.  INLINE $303C,$061C,$A816;
  514.  
  515. {  *********************************************************************
  516.  These calls are used to set up and modify the event dispatch table  }
  517.  
  518. { Add an AppleEvent Handler  }
  519. FUNCTION AEInstallEventHandler(theAEEventClass: AEEventClass;
  520.                                theAEEventID: AEEventID;
  521.                                handler: EventHandlerProcPtr;
  522.                                handlerRefcon: LONGINT;
  523.                                isSysHandler: BOOLEAN): OSErr;
  524.  INLINE $303C,$091F,$A816;
  525.  
  526. {  Remove an AppleEvent Handler  }
  527. FUNCTION AERemoveEventHandler(theAEEventClass: AEEventClass;
  528.                               theAEEventID: AEEventID;
  529.                               handler: EventHandlerProcPtr;
  530.                               isSysHandler: BOOLEAN): OSErr;
  531.  INLINE $303C,$0720,$A816;
  532.  
  533. {  Get the corresponding AppleEvent Handler  }
  534. FUNCTION AEGetEventHandler(theAEEventClass: AEEventClass;
  535.                            theAEEventID: AEEventID;
  536.                            VAR handler: EventHandlerProcPtr;
  537.                            VAR handlerRefcon: LONGINT;
  538.                            isSysHandler: BOOLEAN): OSErr;
  539.  INLINE $303C,$0921,$A816;
  540.  
  541. {  *********************************************************************
  542.  These calls are used to set up and modify the coercion dispatch table   }
  543. FUNCTION AEInstallCoercionHandler(fromType: DescType;
  544.                                   toType: DescType;
  545.                                   handler: ProcPtr;
  546.                                   handlerRefcon: LONGINT;
  547.                                   fromTypeIsDesc: BOOLEAN;
  548.                                   isSysHandler: BOOLEAN): OSErr;
  549.  INLINE $303C, $0A22, $A816;
  550.  
  551. {  Remove a Coercion Handler  }
  552. FUNCTION AERemoveCoercionHandler(fromType: DescType;
  553.                                  toType: DescType;
  554.                                  handler: ProcPtr;
  555.                                  isSysHandler: BOOLEAN): OSErr;
  556.  INLINE $303C, $0723, $A816;
  557.  
  558. {  Get the corresponding Coercion Handler  }
  559. FUNCTION AEGetCoercionHandler(fromType: DescType;
  560.                               toType: DescType;
  561.                               VAR handler: ProcPtr;
  562.                               VAR handlerRefcon: LONGINT;
  563.                               VAR fromTypeIsDesc: BOOLEAN;
  564.                               isSysHandler: BOOLEAN): OSErr;
  565.  INLINE $303C, $0B24, $A816;
  566.  
  567.    *********************************************************************
  568.  These calls are used to set up and modify special hooks into the AppleEvent Manager.
  569.  
  570.  Install the special handler named by the Keyword   }
  571. FUNCTION AEInstallSpecialHandler(functionClass: AEKeyword;
  572.                                  handler: ProcPtr;
  573.                                  isSysHandler: BOOLEAN): OSErr;
  574.  INLINE $303C, $0500, $A816;
  575.  
  576. {  Remove the special handler named by the Keyword  }
  577. FUNCTION AERemoveSpecialHandler(functionClass: AEKeyword;
  578.                                 handler: ProcPtr;
  579.                                 isSysHandler: BOOLEAN): OSErr;
  580.  INLINE $303C, $0501, $A816;
  581.  
  582. {  Get the special handler named by the Keyword  }
  583. FUNCTION AEGetSpecialHandler(functionClass: AEKeyword;
  584.                              VAR handler: ProcPtr;
  585.                              isSysHandler: BOOLEAN): OSErr;
  586.  INLINE $303C, $052D, $A816;
  587.  
  588.  
  589. {$ENDC} { UsingAppleEvents }
  590.  
  591. {$IFC NOT UsingIncludes}
  592.  END.
  593. {$ENDC}
  594.  
  595.